package cn.itcast.dmp.report

import cn.itcast.dmp.config.AppConfigHelper
import cn.itcast.dmp.process.ReportProcessor
import org.apache.spark.sql.{DataFrame, SparkSession}
//设备维度：广告投放的设备分布
object ReportAdsDeviceProcessor extends ReportProcessor {
  override def targetTableName: String = {
    AppConfigHelper.REPORT_ADS_DEVICE_TABLE_NAME
  }
  override def targetTableKeys() = {
    Seq("report_date", "client", "device")
  }


  override def realProcessData(odsDF: DataFrame): DataFrame ={
    val spark: SparkSession = odsDF.sparkSession
    odsDF.createTempView("shepei")
    val dataFrame: DataFrame = spark.sql(ReportSQLConstant.reportAdsKpiWithSQL("shepei",Seq("client", "device")))

    dataFrame
  }
}
